#ifndef __SHOOTER_ENCODER_H
#define __SHOOTER_ENCODER_H

#include <stdint.h>
#include "main.h"
#include "spi.h"
#include "cmsis_os2.h"

typedef struct _shooter_encoder_t {
    SPI_HandleTypeDef *hspi;
    int last_pos;
    uint16_t rx_data;
    int *target;
    osMutexId_t tar_mutex;
    osThreadId_t task;
} shooter_encoder_t;

void shooter_encoder_init(shooter_encoder_t *enc, SPI_HandleTypeDef *hspi, int *target, osMutexId_t tar_mutex);

#endif